package com.xiaoxin.smartbi.bizmq;

import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;

public class BiMqInit {

    public static void main(String[] args)  {
        ConnectionFactory factory = new ConnectionFactory();
        factory.setHost("localhost");
        Connection connection = null;
        try {
            connection = factory.newConnection();
            Channel channel = connection.createChannel();
            channel.exchangeDeclare("bi_copy_exchange", "direct");
            channel.queueDeclare("bi_copy_queue", true, false, false, null);
            channel.queueBind("bi_copy_queue", "bi_copy_exchange", "bi_copy_routingKey");
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
